package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** SkillLevel数据管理 */
public class SkillLevelDBModel extends AbstractDBModel<SkillLevelDBModel, SkillLevelEntity>
{
    private static SkillLevelDBModel instance;

    public static SkillLevelDBModel getInstance() {
        if (instance == null) {
            instance = new SkillLevelDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "SkillLevel.data";
    }

    /** 创建实体 */
    @Override
    protected SkillLevelEntity MakeEntity(GameDataTableParser parse)
    {
        SkillLevelEntity entity = new SkillLevelEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.SkillId = parse.GetFieldValueToInt("SkillId");
        entity.Level = parse.GetFieldValueToInt("Level");
        entity.HurtValueRate = parse.GetFieldValueToInt("HurtValueRate");
        entity.SpendMP = parse.GetFieldValueToInt("SpendMP");
        entity.StateTime = parse.GetFieldValueToFloat("StateTime");
        entity.AbnormalRatio = parse.GetFieldValueToFloat("AbnormalRatio");
        entity.AStateTimes = parse.GetFieldValueToInt("AStateTimes");
        entity.AStatexiaohao = parse.GetFieldValueToInt("AStatexiaohao");
        entity.SkillCDTime = parse.GetFieldValueToFloat("SkillCDTime");
        entity.BuffChance = parse.GetFieldValueToFloat("BuffChance");
        entity.BuffDuration = parse.GetFieldValueToFloat("BuffDuration");
        entity.BuffValue = parse.GetFieldValueToInt("BuffValue");
        entity.NeedCharacterLevel = parse.GetFieldValueToInt("NeedCharacterLevel");
        entity.SpendGold = parse.GetFieldValueToInt("SpendGold");
        return entity;
    }
}
